package com.aos.erp.gov.ex.service.impl;


import com.aos.erp.common.bean.IPageBean;
import com.aos.erp.common.bean.PageBean;
import com.aos.erp.common.dao.mapper.Condition;
import com.aos.erp.common.exception.BizException;

import  com.aos.erp.gov.ex.service.GovExRegisterCnExecuteService;
import  com.aos.erp.gov.ex.model.GovExRegisterCnExecute;
import  com.aos.erp.gov.ex.mapper.GovExRegisterCnExecuteMapper;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;


@Service
public class GovExRegisterCnExecuteServiceImpl extends ServiceImpl<GovExRegisterCnExecuteMapper,GovExRegisterCnExecute> implements GovExRegisterCnExecuteService {

    @Override
    public GovExRegisterCnExecute getById(long id) {
        return baseMapper.selectById(id);
    }

    @Override
    public void addBean(GovExRegisterCnExecute bean) throws BizException {
        baseMapper.insert(bean);
    }

    @Override
    public PageBean<GovExRegisterCnExecute> queryByPage(long pageIndex, long pageSize) {

        IPageBean<GovExRegisterCnExecute> pageBean = baseMapper.createBizPage(pageIndex, pageSize);
        Condition condition = new Condition(GovExRegisterCnExecute.class);
        condition.orderByDesc("id");

        return (PageBean<GovExRegisterCnExecute>) baseMapper.selectPage(pageBean, condition.getWrapper());
    }
}